/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.


See LICENSE and AUTHORS for more information.
*/

#ifndef BUDDYITEM_H
#define BUDDYITEM_H

#include <QList>
#include <QVariant>
#include <QVector>

/**
* @class BuddyItem
* @brief the item to the BuddyModel
*
* BuddyItem is used as the Item to the BuddyModel
* It is a hierachical Tree-Item that has a parent item and can have multiple children itself.
* It may have an unlimited amount of data-columns
*/
class BuddyItem
{
public:
    BuddyItem(const QVector<QVariant> &data, BuddyItem *parent = 0);
    ~BuddyItem();

    BuddyItem *child(int number);
    int childCount() const;
    int columnCount() const;
    QVariant data(int column) const;
    bool insertChildren(int position, int count, int columns);
    bool insertColumns(int position, int columns);
    BuddyItem *parent();
    bool removeChildren(int position, int count);
    bool removeColumns(int position, int columns);
    int childNumber() const;
    bool setData(int column, const QVariant &value);

private:
    QList<BuddyItem*> childItems;
    QVector<QVariant> itemData;
    BuddyItem *parentItem;
};

#endif

